package com.hxzy.controller;

import com.hxzy.common.R;
import com.hxzy.entity.Type;
import com.hxzy.service.TypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/types")
@Slf4j
public class TypeController {
    @Autowired
    private TypeService typeService;

    @GetMapping("/list")
    public R<List<Type>> selectTypeList(){
        log.info("进入 selectTypeList 方法...");
        List<Type> typeList = typeService.selectTypeList();
        return R.success(typeList);
    }
}
